export const getScaleCanvasSize = (
  width: number,
  height: number,
  maxSize: number
) => {
  if (width == null || height == null) {
    return {
      width: 0,
      height: 0,
    }
  }
  const scale = Math.min(maxSize / width, maxSize / height)
  return {
    width: width * scale,
    height: height * scale,
  }
}
